import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '页面',
    align:"center",
    dataIndex: 'pageId'
   },
   {
    title: '访问次数',
    align:"center",
    sorter: true,
    dataIndex: 'browseNum'
   },
   {
    title: '模块类别',
    align:"center",
    dataIndex: 'typeId'
   },
   {
    title: '城市',
    align:"center",
    dataIndex: 'cityId'
   },
   {
    title: '租户',
    align:"center",
    dataIndex: 'tenantId_dictText'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "页面",
      field: "pageId",
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "访问次数",
      field: "browseNum",
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "模块类别",
      field: "typeId",
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "城市",
      field: "cityId",
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "租户",
      field: "tenantId",
      component: 'JSearchSelect',
      componentProps:{
         dict:"sys_tenant,name,id"
      },
      //colProps: {span: 6},
 	},
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '页面',
    field: 'pageId',
    component: 'InputNumber',
  },
  {
    label: '访问次数',
    field: 'browseNum',
    component: 'InputNumber',
  },
  {
    label: '模块类别',
    field: 'typeId',
    component: 'Input',
  },
  {
    label: '城市',
    field: 'cityId',
    component: 'Input',
  },
  {
    label: '租户',
    field: 'tenantId',
    component: 'JSearchSelect',
    componentProps:{
       dict:"sys_tenant,name,id"
    },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

//子表列表数据
export const coupleStatisticsPageDayColumns: BasicColumn[] = [
   {
    title: '页面',
    align:"center",
    dataIndex: 'pageId_dictText'
   },
   {
    title: '访问次数',
    align:"center",
    sorter: true,
    dataIndex: 'browseNum'
   },
   {
    title: '模块类别',
    align:"center",
    dataIndex: 'typeId_dictText'
   },
   {
    title: '主表id',
    align:"center",
    dataIndex: 'mainId'
   },
   {
    title: '日期',
    align:"center",
    dataIndex: 'day'
   },
   {
    title: '城市',
    align:"center",
    dataIndex: 'cityId'
   },
   {
    title: '租户',
    align:"center",
    dataIndex: 'tenantId_dictText'
   },
];
//子表表单数据
export const coupleStatisticsPageDayFormSchema: FormSchema[] = [
  // TODO 子表隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false
  },
  {
    label: '页面',
    field: 'pageId',
    component: 'JSearchSelect',
    componentProps:{
       dict:""
    },
  },
  {
    label: '访问次数',
    field: 'browseNum',
    component: 'InputNumber',
  },
  {
    label: '模块类别',
    field: 'typeId',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"module_statistics_page"
     },
  },
  {
    label: '主表id',
    field: 'mainId',
    component: 'Input',
  },
  {
    label: '日期',
    field: 'day',
    component: 'Input',
  },
  {
    label: '城市',
    field: 'cityId',
    component: 'Input',
  },
  {
    label: '租户',
    field: 'tenantId',
    component: 'JSearchSelect',
    componentProps:{
       dict:"sys_tenant,name,id"
    },
  },
];
